
package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type SystemRouteRequest struct {

	CateId string `json:"cate_id" form:"cate_id"`

	AppName string `json:"app_name" form:"app_name"`

	Name string `json:"name" form:"name"`

	Describe string `json:"describe" form:"describe"`

	Path string `json:"path" form:"path"`

	Method string `json:"method" form:"method"`

	FilePath string `json:"file_path" form:"file_path"`

	Action string `json:"action" form:"action"`

	Query string `json:"query" form:"query"`

	Header string `json:"header" form:"header"`

	Request string `json:"request" form:"request"`

	RequestType string `json:"request_type" form:"request_type"`

	Response string `json:"response" form:"response"`

	RequestExample string `json:"request_example" form:"request_example"`

	ResponseExample string `json:"response_example" form:"response_example"`

	Type string `json:"type" form:"type"`

	AddTime string `json:"add_time" form:"add_time"`

	DeleteTime string `json:"delete_time" form:"delete_time"`

	ErrorCode string `json:"error_code" form:"error_code"`

}

func (r *SystemRouteRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *SystemRouteRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"cate_id": "required",

		"app_name": "required",

		"name": "required",

		"describe": "required",

		"path": "required",

		"method": "required",

		"file_path": "required",

		"action": "required",

		"query": "required",

		"header": "required",

		"request": "required",

		"request_type": "required",

		"response": "required",

		"request_example": "required",

		"response_example": "required",

		"type": "required",

		"add_time": "required",

		"delete_time": "required",

		"error_code": "required",

	}
}

func (r *SystemRouteRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *SystemRouteRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *SystemRouteRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
